home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
JCSM Shareware Collection 1996 September
/
JCSM Shareware Collection (JCS Distribution) (September 1996).ISO
/
tutorial
/
trac.zip
/
FIGIV-1.OBJ
< prev
next >
Wrap
Text File
|
1990-01-25
|
4KB
|
54 lines
0009 0 0009 0 Origin
0010 401000 STRT RD X Read X (Also sets next 4 locations to zero)
0011 001000 LD X Load accumulator with X
0012 250048 BZSTOP If X is zero jump to halt instruction
0013 240017 BN*+4 If X is negative, skip next 3 instructions
0014 001501 LD ONE Load +1
0015 031502 ST S Store at S (sign)
0016 260022 BU*+6 Branch unconditionally around next 5
0017 001503 LDNEG1 Load -1
0018 031502 ST S Store at S
0019 001500 LDZERO Load zero
0020 021000 SU X Subtract X (This makes a negative X positive)
0021 031000 ST X Store back at X
0022 001501 LD ONE Load 1
0023 030002 ST I I=1 using index register 2
0024 001000 LD X Load X
0025 360008 SR0008 Shift it right 8
0026 031001 ST Y Store at Y
0027 001001 LOOP LD Y Load Y (Note this is the start of a loop)
0028 151504 MU ATE Multiply by 8
0029 031001 ST Y Store at Y
0030 001000 LD X Load X
0031 2370000 2SL0000 Shift left by I (Contents of register 2)
0032 360008 SR0008 Shift right 8 (This isolates an octal digit)
0033 011001 AD Y Add previous Y
0034 031001 ST Y Store back at Y
0035 000002 LD I Load I
0036 011501 AD ONE Add 1
0037 030002 ST I Store at I
0038 021505 SUNINE Subtract 9 to see if done
0039 240027 BNLOOP If negative repeat loop
0040 001000 LD X Load X
0041 151502 MU S Multiply by sign
0042 031000 ST X Store at X
0043 001001 LD Y Load Y
0044 151502 MU S Multiply by sign
0045 031001 ST Y Store at Y
0046 411000 PC X Print X, Y
0047 260010 BUSTRT Branch back to start
0048 500000 STOP HT0000 Halt
0001 0 0001 0 Re-origin to define I
0002 0 I 0
1499 0 1499 0 Re-origin for constants
1500 0 ZERO 0 Zero
1501 1 ONE 1 One
1502 0 S 0
1503 -1 NEG1 -1 Negative one
1504 8 ATE 8 Eight
1505 9 NINE 9 Nine
0999 0 0999 0 Re-origin for read area
1000 0 X 0
1001 0 Y 0
9999 000010 ENSTRT End of code and starting location